<?php
/**
* Logout handler.
*
* Copyright (c) 2009 James Gauld <james@jamesgauld.net>
* This file is part of Scribble.
* @license http://www.scribblecms.co.uk/license.txt
*
* @package Scribble
*/
use Buan\Core;
use Buan\Config;
use Buan\PhpViewEngine;
use Buan\UrlCommand;
class LogoutController extends ScribbleAdminController {

	/**
	* Logout from Scribble and redirect to Scribble login page.
	*
	* @param array Action parameters (none supported)
	* @return void
	*/
	public function index($params) {
		ScribbleSession::logout();
		session_write_close();
		$v = new ScribblePublicView();
		$v->loadHelper('html');
		header("Location: ".$v->helpers->html->eUrl(UrlCommand::createUrl('scribble'), FALSE));
		exit();
	}
}
?>